<template>
  <div id="top">
    <el-button type="primary" size="mini" @click="dialogVisible = true"
      >查看数据</el-button
    >
    <el-dialog
      title="查看数据"
      :visible.sync="dialogVisible"
      width="30%"
      id="topDialog"
    >
      <p v-html="$store.state.viewList" class="content"></p>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="dialogVisible = false" size="small"
          >关 闭</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      dialogVisible: false,
    };
  },
};
</script>
<style lang="scss" scoped>
#top {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 20px;
  .content {
    height: 30rem;
    overflow-y: scroll;
    white-space: pre-wrap;
    text-align: left;
    padding: 0 2rem;
    color: #66b1ff;
  }
  .content::-webkit-scrollbar {
    /*滚动条整体样式*/
    width: 2px; /*高宽分别对应横竖滚动条的尺寸*/
    height: 1px;
  }
}
</style>

<style lang="scss">
#top {
  .el-dialog__wrapper {
    top: -4rem;
  }
  #topDialog {
    .el-dialog__header {
      padding: 12px 20px 10px;
    }
    .el-dialog__body {
      padding: 1px 20px;
    }
  }
}
</style>
